import { Component, OnInit } from '@angular/core'
import {DictService} from "@shared/utils/dict.service";

@Component({
  selector: 'app-tag-create-customer',
  templateUrl: './tag-create-customer.component.html',
  styleUrls: ['./tag-create-customer.component.scss']
})
export class TagCreateCustomerComponent implements OnInit {
  public sex;
  public age ={minAge:'',maxAge:''};
  public educational ='';//学历
  public customerlevel ='';//客户等级
  public risklevel =''//风险等级
  public customertype ='';//客户类型
  public cardLevel =[];//卡等级
  public wage;//代发工资
  public custAge =[];//客龄
  public belong;//客户归属

  public asset ={minAsset:'',maxAsset:''};//当前资产管理
  public debt ={minDebt:'',maxDebt:''};//当前资产负债
  public averageAssets = {minAverageAssets:'',maxAverageAssets:''};//月日均资产
  public assetChange =[];//资产变化趋势
  public contribution =[]; //贡献度
  public assetRate;//资产变化率百分比

  public financia ={minFinancia:'',maxFinancia:''}; //理财
  public currDepBal ={minCurrDepBal:'',manCurrDepBal:''};//活期
  public fixedDepBal ={minfixedDepBal:'',maxfixedDepBal:''};//定期
  public cardType =[]; //卡类型
  public loan ={minLoan:'',maxLoan:''};//贷款
  public otherProduct =[];//其它产品
  constructor(public dictService: DictService) {}

  ngOnInit() {}
  handle($event){
  }
  submit() {
    let data = {'custAtrr':{}}
    if(this.sex!=''){
      data['custAtrr']['sex'] =this.sex
    }
    if(this.age['minAge']!=''||this.age['maxAge']!=''){
      data['custAtrr']['age'] =this.age
    }
    if(this.educational!=''){
      data['custAtrr']['educational'] =this.educational
    }
    if(this.customerlevel!=''){
      data['custAtrr']['customerlevel'] =this.customerlevel
    }
    if(this.risklevel!=''){
      data['custAtrr']['risklevel'] =this.risklevel
    }
    if(this.customertype!=''){
      data['custAtrr']['customertype'] =this.customertype
    }
    return data

    // return true
    // return {'custAtrr':{
    //   sex: this.sex,
    //   age: this.age,
    //   educational: this.educational,
    //   cardLevel: this.cardLevel,
    //   custAge: this.custAge,
    //   contribution: this.contribution,
    //   cardType: this.cardType,
    //   belong: this.belong,
    //   asset: this.age,
    //   otherProduct:this.otherProduct,
    //   loan:this.loan,
    //   fixedDepBal:this.fixedDepBal,
    //   currDepBal:this.currDepBal,
    //   financia:this.financia,
    //   assetRate:this.assetRate,
    //   assetChange:this.assetChange,
    //   averageAssets:this.averageAssets,
    //   debt:this.debt,
    //   wage:this.wage
    //
    // }}
  }
}
